package com.pansoft.kline.greendao;

import com.efounder.util.AppContext;

import org.greenrobot.greendao.database.Database;

/**
 * @autor yqs
 * @date 2018/11/21 15:48
 **/
public class DaoSessionUtil {

        private static DaoSession daoSession;
    public static DaoSession getInstance() {
        if (daoSession == null) {
//            DaoMaster.DevOpenHelper helper = new DaoMaster.DevOpenHelper(AppContext.getInstance(), "bikan_config.db");
            MySQLiteOpenHelper helper = new MySQLiteOpenHelper(AppContext.getInstance(), "bikan_config.db");
            Database db = helper.getWritableDb();
            daoSession = new DaoMaster(db).newSession();
        }
        return daoSession;
    }
}
